﻿namespace ArticleClientLib
{
    public class ArticleSyncJson
    {
        public long id { get; set; }
        public string title { get; set; }
        public string content { get; set; }
        public string text { get; set; }
        public string author { get; set; }
        public string source { get; set; }
        public string imageUrl { get; set; }
        public string date { get; set; }



        public string[] GetImages()
        {
            return content.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
        }

        public string GetMain()
        {
            return imageUrl;
        }

        public ArticleJson ToArticleJson()
        {
            return new ArticleJson
            {
                content = text,
                author = author,
                source = source,
                title = title,
            };
        }



    }

}